﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WJP.Utils.CodeTimer;

namespace IOCSample
{
    class Program
    {
        static void Main(string[] args)
        {
            CodeTimer.Initialize();

            int Iteration = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["Iteration"] ?? "10000");
            Console.WriteLine("运行次数：{0}".FormatArgs(Iteration));

            Console.WriteLine("IOC - Singleton");
            // Autofac Singleton 
            RunManager.Start(new AutofacRunner(), RunType.Singleton);
            // Castle Windsor 
            RunManager.Start(new WindsorRunner(), RunType.Singleton);
            // New Singleton 
            RunManager.Start(new NewRunner(), RunType.Singleton);

            Console.WriteLine("===================================");
            Console.WriteLine("IOC - Transient");
            // Autofac Transient 
            RunManager.Start(new AutofacRunner(), RunType.Transient);
            // Castle Windsor Transient
            RunManager.Start(new WindsorRunner(), RunType.Transient);
            // New Transient 
            RunManager.Start(new NewRunner(), RunType.Transient);

            Console.ReadKey();
        }
    }
}
